package com.njmaomao.gj.pyot.domain.wechat;

import com.njmaomao.gj.pyot.common.bean.BaseRequest;

import java.io.Serializable;

/**支付结果回调到其他业务系统的消息
 * @author dylan
 * @time 2018/5/22.
 */
public class PayCallbackMessage extends BaseRequest implements Serializable{

    /**
     *订单号
     */
    private String orderCode;
    /**
     * 交易流水号
     */
    private String tradeNo;

    /**
     * 订单来源系统
     */
    private String sourceSystem;
    /**
     * 实际支付金额
     */
    private Integer totalAmount;
    /**
     * 支付状态（同PayRecord的status）
     */
    private int status;

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getSourceSystem() {
        return sourceSystem;
    }

    public void setSourceSystem(String sourceSystem) {
        this.sourceSystem = sourceSystem;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    /**
     *
     * @return
     */
    public static Builder newBuilder(){
        return new Builder(new PayCallbackMessage());
    }

    /**
     *
     */
    public static class  Builder{
        private PayCallbackMessage message;

        public Builder(PayCallbackMessage message) {
            this.message = message;
        }

        public Builder withSeqNo(String seqNo){
            message.setSeqNo(seqNo);
            return this;
        }

        public Builder withFromSystem(String fromSystem){
            message.setFromSystem(fromSystem);
            return this;
        }

        public Builder withSourceSystem(String sourceSystem){
            message.setSourceSystem(sourceSystem);
            return this;
        }

        public Builder withOrderCode(String orderCode){
            message.setOrderCode(orderCode);
            return this;
        }

        public Builder withTradeNo(String tradeNo){
            message.setTradeNo(tradeNo);
            return this;
        }

        public Builder withTotalAmount(int totalAmount){
            message.setTotalAmount(totalAmount);
            return this;
        }

        public Builder withStatus(int status){
            message.setStatus(status);
            return this;
        }

        public PayCallbackMessage build(){
            return message;
        }
    }
}
